package no.ntnu.fp.model;

public class Message {
	private int ID = -1;
	private Person to;
	private Person from;
	private String subject;
	private String text;
	private int moteID = 0;
	private MessageType type;
	
	public Message(Person to, String title, String message){
		// auto-add self as from or alternatively just add it...
		// hopefully make the constructor accsess the insert in messageQuary so that making a new message is simple.
		this.to = to;
		this.subject = title;
		this.text = message;
		this.type = MessageType.SUMMON;
		
	}
	
	public Message(Person to, Person from, String title, String message, int moteID, int ID, MessageType type){
		this.to = to;
		this.from = from;
		this.subject = title;
		this.text = message;
		this.ID = ID;
		this.moteID = moteID;
		this.type = type;
	}
	
	public Message(Person to, Person from, String title, String message, int moteID, MessageType type){
		this.to = to;
		this.from = from;
		this.subject = title;
		this.text = message;
		this.moteID = moteID;
		this.type = type;
	}
	
	public Person getTo() {
		return to;
	}
	
	public void setTo(Person to) {
		this.to = to;
	}
	
	public MessageType getType() {
		return type;
	}
	
	public void setType(MessageType type) {
		this.type = type;
	}
	
	public Person getFrom() {
		return from;
	}
	
	public void setFrom(Person from) {
		this.from = from;
	}
	
	public String getSubject() {
		return subject;
	}
	
	public void setSubject(String subject) {
		this.subject = subject;
	}
	
	public String getText() {
		return text;
	}
	
	public void setText(String text) {
		this.text = text;
	}
	
	public void setID(int iD) {
		ID = iD;
	}
	
	public int getID() {
		return ID;
	}
	
	public void setMoteID(int moteID) {
		this.moteID = moteID;
	}
	
	public int getMoteID() {
		return moteID;
	}
	
	@Override
	public String toString() {
		return subject + "\n " + from.getName();
	}
}
